// routes路由配置的类型限制
import type { RouteRecordRaw } from 'vue-router';
//引入课程路由的二级路由---会员专区，视频课，直播课，线下课，主题
//引入一级路由课程的二级路由会员专区组件
import vip from '../views/discovery/components/Vip.vue';
//引入一级路由课程的二级路由视频课组件
import video from '../views/discovery/components/Vip.vue'
//引入一级路由课程的二级路由直播课组件
import zhibo from '../views/discovery/components/Vip.vue'
//引入一级路由课程的二级路由线下课组件
import xianxiake from '../views/discovery/components/Vip.vue'
//引入一级路由课程的二级路由主题组件
import zhuti from '../views/discovery/components/Vip.vue'
// 暴露路由
export const routes = [
    //登录的路由
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            hidden: true
        }
    },
    //404路由
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/error/404.vue'),
        meta: {
            hidden: true
        }
    },
    /* 匹配任意的路由 必须最后注册 */
  {
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/404',
    meta: {
      hidden: true
    }
  },
    {
        path: '/userinfo',
        component: () => import('@/layout/userInfo/index.vue'),
        meta: {
            hidden: true
        }
    },
 //home首页
//  {
//     path: '/',
//     component: () => import('@/views/recommend/index.vue'),
//     redirect: '/recommend',
//     children: [{
//       path: 'recommend',
//       component: () => import('@/views/recommend/index.vue'),
     
//     }]
//   },

    {
        path: '/',
        redirect: '/recommend',
        children: [
            {
                path: '/recommend',
                name: 'Recommend',
                component: () => import('@/views/recommend/index.vue')

            },
            // 课程路由
            {
                path: '/discovery',
                name: 'Discovery',
                component: () => import('@/views/discovery/index.vue'),
                children:[
                    {
                        //二级路由会员专区
                        path:'vip',
                        component:() => import("@/views/discovery/components/Vip.vue"),
                        name:vip,
                        meta: {
                            show:true,
                        }
                    },
                    {
                        //二级路由视频课
                        path:'video',
                        component:() => import("@/views/discovery/components/Video.vue"),
                        name:video,
                        meta: {
                            show:true,
                        }
                    },
                    {
                        //二级路由直播课
                        path:'zhibo',
                        component:() => import("@/views/discovery/components/zhibo.vue"),
                        name:zhibo,
                        meta: {
                            show:true,
                        }
                    },
                    {
                        //二级路由线下课
                        path:'xianxiake',
                        component:() => import("@/views/discovery/components/xianxiake.vue"),
                        name:xianxiake,
                        meta: {
                            show:true,
                        }
                    },
                    {
                        //二级路由主题
                        path:'zhuti',
                        component:() => import("@/views/discovery/components/zhuti.vue"),
                        name:"zhuti",
                        meta: {
                            show:true,
                        }
                    },
                ]

            },
            //练习室路由
            {
                path: '/room',
                name: 'Romm',
                component: () => import('@/views/room/index.vue'),
                redirect: '/room/myroom',
                children: [
                    {
                        path: 'myroom',
                        component: () => import('@/views/room/roomItem/myroom.vue')
                    },
                    {
                        path: 'store',
                        component: () => import('@/views/room/roomItem/store.vue')
                    },
                    {
                        path: 'history',
                        component: () => import('@/views/room/roomItem/history.vue')
                    },
                    {
                        path: 'roomitem',
                        component: () => import('@/views/room/roomItem/roomItem.vue')
                    }
                ]

            },
            {
                path: '/communicaitio',
                name: 'Communicaitio',
                component: () => import('@/views/communicaitio/index.vue')
            },
            //我的---路由
            {
                path: '/my',
                component: () => import('@/views/my/index.vue'),
                redirect: '/my/dynamics',
                children: [
                    {
                        path: 'dynamics',
                        component: () => import('@/views/my/DynamicResources/index.vue')
                    },
                    {
                        path: 'vip',
                        component: () => import('@/views/my/MyVip/index.vue')
                    },
                    {
                        path: 'information',
                        component: () => import('../views/my/MyInformation/index.vue')
                    },
                ]
            },

        ]
    }





    //  资源
    // {
    //     path: '/recommend',
    //     name: 'Recommend',
    //     component: () => import('@/views/recommend/index.vue')
    // },
    // {
    //     path: '/discovery',
    //     name: 'Discovery',
    //     component: () => import('@/views/discovery/index.vue')
    // },
    // {
    //     path: '/room',
    //     name: 'Romm',
    //     component: () => import('@/views/room/index.vue')
    // },
    // {
    //     path: '/communicaitio',
    //     // name: 'Discovery',
    //     component: () => import('@/views/communicaitio/index.vue')
    // },
    // {
    //     path: '/my',
    //     name: 'My',
    //     component: () => import('@/views/my/index.vue')
    // }
]